import { Tooltip } from "antd";

/** 处理文件溢出的时候省略号 */
export const ellipsisHandler = (value: string) => {
    return (
        <Tooltip placement="topLeft" title={value}>
            {value}
        </Tooltip>
    );
};

/** table的序号列 */
export const columnDataIndex: any = {
    dataIndex: 'index',
    title: '序号',
    width: 60,
    fixed: 'left',
    align: 'center',
    render: (_:any, __:any, index: number) => {
        return <strong> {index + 1} </strong>;
    }
};
/** table备注信息列 */
export const columnRemark: any = {
    key: 'remark',
    dataIndex: 'remark',
    title: '备注信息',
    width: 100,
    align: "center",
    ellipsis: {showTitle: false},
    render: ellipsisHandler
};
/** table数据排序列 */
export const columnOrder: any = {
    key: 'order',
    dataIndex: 'order',
    title: '排序',
    width: 100,
    align: "center"
};


